package com.watch.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.watch.system.model.bo.UserBO;
import com.watch.system.model.bo.UserFormBO;
import com.watch.system.model.dto.UserAuthInfo;
import com.watch.system.model.entity.CarUser;
import com.watch.system.model.entity.SysUser;
import com.watch.system.model.form.CarUserForm;
import com.watch.system.model.query.CarUserPageQuery;
import com.watch.system.model.query.UserPageQuery;
import com.watch.system.model.vo.*;
import com.watch.system.plugin.mybatis.annotation.DataPermission;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 用户持久层
 *
 * @author haoxr
 * @since 2022/1/14
 */
@Mapper
public interface CarUserMapper extends BaseMapper<CarUser> {

    /**
     * 获取用户分页列表
     *
     * @param page
     * @param queryParams 查询参数
     * @return
     */
    Page<CarUserPageVO> getUserPage(Page<CarUserPageVO> page, CarUserPageQuery queryParams);

    /**
     * 获取用户表单详情
     *
     * @param userId 用户ID
     * @return
     */
    UserFormBO getUserDetail(Long userId);

    /**
     * 根据用户名获取认证信息
     *
     * @param username
     * @return
     */
    UserAuthInfo getUserAuthInfo(String username);

    CarUser selectUserById(Integer userId);

    /**
     * 获取导出用户列表
     *
     * @param queryParams
     * @return
     */

    List<CarUserExportVO> listExportUsers(CarUserPageQuery queryParams);

    Page<CarUserPageVO> getUserVipPage(Page<CarUserPageVO> page, CarUserPageQuery queryParams);

    int updateCarUser(CarUserForm userForm);

    Page<CarAuthPageVO> selectMyGaragePage(Page<CarAuthPageVO> page, CarUserPageQuery queryParams);

    Page<CarAdPageVO> selectMyAdPage(Page<CarAuthPageVO> page, CarUserPageQuery queryParams);

    Page<CarUserPageVO> selectMyLikePage(Page<CarUserPageVO> page, CarUserPageQuery queryParams);

    Page<CarUserPageVO> selectMyVisitorPage(Page<CarUserPageVO> page, CarUserPageQuery queryParams);

    Page<CarUserPageVO> selectMyFollowPage(Page<CarUserPageVO> page, CarUserPageQuery queryParams);

    Page<CarSharePageVO> selectMySharePage(Page<CarAuthPageVO> page, CarUserPageQuery queryParams);

    int insertImport(CarUserImportVO userImportVO);

    Page<CarAttPageVO> selectUserAtrPage(Page<CarAttPageVO> page, CarUserPageQuery queryParams);

    List<CarAuthPageVO> selectMyGarageList(CarUserPageQuery queryParamsTemp);
}
